<?php


namespace App\Engine;


use App\Models\Sys;
use EasyWeChat\Factory;

class UserService
{
    public function xcx_app()
    {
        $appid = Sys::where('key', 'wx_appid')->value('value');
        $secret = Sys::where('key', 'wx_secret')->value('value');
        $config = [
            'app_id' => $appid,
            'secret' => $secret,

            // 下面为可选项
            // 指定 API 调用返回结果的类型：array(default)/collection/object/raw/自定义类名
            'response_type' => 'array',

            'log' => [
                'level' => 'debug',
              //  'file' => ROOT.'/storage/logs/wechat.log',
            ],
        ];
        $app=Factory::miniProgram($config);
        return $app;
    }

}
